import RPi.GPIO as GPIO
from . import dht11

# initialize GPIO
GPIO.setwarnings(True)
GPIO.setmode(GPIO.BCM)

class DHT11:

    def __init__(self):
        self.instance = dht11.DHT11(pin=4)
        self.t=0
        self.h=0

    def get_th(self):
        result = self.instance.read()
        if result.is_valid():
            self.t = result.temperature
            self.h= result.humidity+20

        